<?php
class Application_Model_Persona2 extends Zend_Db_Table_Abstract
{
    protected $_name ='persona';
    protected $_primary ='id_persona';
    protected $_dependentTables=array('Application_Model_Autores','Application_Model_Tutores');


    public function getAll()
    {
        return $this->fetchAll();
    }
    
    public function save($bind,$id_persona=null)
    {
        if(is_null($id_persona)){
            $row=$this->createRow();
        }else{
            $row=$this->getRow($id_persona);
        }
        $row->nombre=$bind['nombre'];
        $row->a_paterno=$bind['apellidoPaterno'];
        $row->a_materno=$bind['apellidoMaterno']; 
        $row->email=$bind['email']; 
        return $row->save(); 
    }
    public function save2($nombre,$aPaterno,$aMaterno,$email)
    {
        $row=$this->createRow();
        $row->nombre=$nombre;
        $row->a_paterno=$aPaterno;
        $row->a_materno=$aMaterno; 
        $row->email=$email;
        return $row->save(); 
    }
    public function getRow($id){
        $id=(int)$id;
        $row=$this->find($id)->current();
        return $row;
    }
}